% TEST_ID: LANG-EXPAND-0020
% CATEGORY: language/array-ops/modify
% 测试 double 数组的赋值行为

function test_double_modify
    B = reshape(1:24, 2, 3, 4);

    B(2, 3, 4) = 100;
    assert(B(end) == 100);

    B(1:10) = 10;
    assert(isequal(B(1:10), 10*ones(1,10)));

    B(1, :, 3) = 5;
    assert(isequal(B(1, :, 3), 5*ones(1, 3)));

    B(:, :, 3) = reshape(6:-1:1, 2, 3);
    assert(isequal(B(:,:,3), [6 4 2; 5 3 1]));
end